// pages/event/event.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
      msg:"hello",
      arrs:[20,30,89,100],
      index:0,
      num:0,
      items:[
        {
          name:"CHN",
          value:"中国",
          checked:true
        },
        {
          name:"USA",
          value:"美国"
        },
        {
          name:"JPN",
          value:"日本"
        },
        {
          name:"BRA",
          value:"巴西"
        }
      ]
  },
  onLoad(options){
    console.log(options);//里面包含参数信息

  },
  
 
  doClick(e){//表示事件对象
    console.log(e);
    
  },
  tabBox1(){
    console.log("box1");
  },
  tabBox2(){
    console.log("box2");
  },
  tabBox3(){
    console.log("box3");
  },
  getUserInfo(e){
    console.log(e.detail.userInfo);
    this.setData({
      user:e.detail.userInfo
    });
  },
  getUserProfile(e){
   
    wx.getUserProfile({
      desc: '获取用户信息',
      success:res => {
        
          this.setData({
            currentUser:res.userInfo
          });
      }
    })
  },
  doParam(e){
    console.log(e.currentTarget.dataset.msg);
  },
  doParam2(e){
    console.log(e.currentTarget.dataset);
  },
  doInput(e){
    // console.log(e.detail.value);
    this.setData({
      name:e.detail.value
    });
  },
  doCheckBox(e){
    console.log(e.detail.value);
  },
  doPicker(e){
    // console.log(e.detail.value);
    this.setData({
      index:e.detail.value
    });
  },
  doAdd(){
    // console.log(this.data.num);
    this.setData({
      num:this.data.num+1
    });
  },
  doMinus(){
    if(this.data.num>0){
      this.setData({
        num:this.data.num-1
      });
    }
    
  }
})